<?php
class User{
   public $name = "";

    function __construct()
    {
        $this->name = "zhangsan";
    }
}

function say(& $u){
    $u = new User();
    $u->name="lisi";
}

$u1 = new User();

echo $u1->name;
say($u1);
echo PHP_EOL;
echo $u1->name;